UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2fdRrArRtuwkrun/FiVJelO5/EN1xbvwfpUPsQxmlA0=' 
WHERE 
  key_id = 'fb3165961c7294f33ba6268ca0fdf15506e90d105465a1ccf4f7102d79788301' 
  AND (
    token = '2fdRrArRtuwkrun/FiVJelO5/EN1xbvwfpUPsQxmlA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051