UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's6y6rxYtoB5gEv12J/0au5PXrYJdByHaKzyRFYgkg64=' 
WHERE 
  key_id = 'b7e13c7c24a8fe76682a134f8223bd75491de8e5fbf4aa5b222933aff67ca547' 
  AND (
    token = 's6y6rxYtoB5gEv12J/0au5PXrYJdByHaKzyRFYgkg64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038