UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sUlmGu4ZQTqaiPGk2BYjdPLXOyeBIb7Gx0Gcmua8uF0=' 
WHERE 
  key_id = 'ccb6f44cee5415f766c5cca9fad1231eb6a6bb2c4d0d9a56edc7b10c22cfccc0' 
  AND (
    token = 'sUlmGu4ZQTqaiPGk2BYjdPLXOyeBIb7Gx0Gcmua8uF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020