UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r/noxd2L86GKX+ttyzri7CI/o7MPSlhTRDDvq0WIXrs=' 
WHERE 
  key_id = 'f01db753d1c54e983dbac6b3712a32dc21c2c1f839713bfa9c3ccfb8d63d4cc5' 
  AND (
    token = 'r/noxd2L86GKX+ttyzri7CI/o7MPSlhTRDDvq0WIXrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022