UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Ox5I0qirjT4accawNk0PAvsVoI7R7zTbpfrdEFDNh4=' 
WHERE 
  key_id = '0d74ac565bc80e9bfe7f8ea6c6e960a5c23da8f95e3f48786ba45edea290b7a7' 
  AND (
    token = '3Ox5I0qirjT4accawNk0PAvsVoI7R7zTbpfrdEFDNh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018