UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/uGn/t+qJKHe8v8sDnnE+3SjiqxtV5QYnq6lHCg54OQ=' 
WHERE 
  key_id = 'a0a1dfe52563898544803610bb9ee43af912efc1d187576aad5158be0eed599f' 
  AND (
    token = '/uGn/t+qJKHe8v8sDnnE+3SjiqxtV5QYnq6lHCg54OQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030