UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ATnBI0OMIxLOKBXw9tL/2f/i3fT6q/LyKPrqBLSLhL0=' 
WHERE 
  key_id = 'a88de16d6f0c655656289f7fc0658066da21db936ed77c824dcbfea129561fe1' 
  AND (
    token = 'ATnBI0OMIxLOKBXw9tL/2f/i3fT6q/LyKPrqBLSLhL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022