UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y25ODqiF9YVEuz/6I6sf3dgxZaF2jW33hxX1a9nQiqo=' 
WHERE 
  key_id = '80db2a9cf3d192233850a94b4c931dac78b59a1f73117b13ed2f8d058b1d2398' 
  AND (
    token = 'y25ODqiF9YVEuz/6I6sf3dgxZaF2jW33hxX1a9nQiqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022