UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AHrHEzhV/JEVHAxJX/boaQvcXVIJCbmoY3uA3ygDleE=' 
WHERE 
  key_id = 'abd402e3c9737ac449b3da00344dcf076413092cddc546b3a50eebb3e257401f' 
  AND (
    token = 'AHrHEzhV/JEVHAxJX/boaQvcXVIJCbmoY3uA3ygDleE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038