UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YNUsRGRzVsy8Bw5o1ofrehf0gej0C7KclWKMFG/RYLY=' 
WHERE 
  key_id = 'cd43ad8348e49fd7262a9b21d32cdcea6cbf6b5c2e93bfda209f7d93c9b4a8fc' 
  AND (
    token = 'YNUsRGRzVsy8Bw5o1ofrehf0gej0C7KclWKMFG/RYLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031