UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c55EV7C2s9eGWvgVKTK9q0s8KgkiB6lIToAkRaY9O3c=' 
WHERE 
  key_id = '8263e9e64945012d39ed7fe527655ff7fbff68daf840fd743ee6ed4f4526d4aa' 
  AND (
    token = 'c55EV7C2s9eGWvgVKTK9q0s8KgkiB6lIToAkRaY9O3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027