UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4Wsya/7G6Il0e2PFQ165EoENykszh7sfuJc8mMfFOw=' 
WHERE 
  key_id = '7ccd7caf1dc7ec7ae6fdc59a44e3d1f8e75299d237968979e6c0aaa79d9f8702' 
  AND (
    token = 'L4Wsya/7G6Il0e2PFQ165EoENykszh7sfuJc8mMfFOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050