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

Query time 0.00059