UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dlQ9P5lK9Xx25Q4oS6pvwhbw8iDxB1IM98QdsR7Aye8=' 
WHERE 
  key_id = '59bea15764be11cc8a301f9036c5d6ac536614abe1290e0fe2dae5bed91289c6' 
  AND (
    token = 'dlQ9P5lK9Xx25Q4oS6pvwhbw8iDxB1IM98QdsR7Aye8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016