UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2phlmo3O1ac34LGRjkgEZDNO0zNz3gshm/1QhMOjRss=' 
WHERE 
  key_id = '4830fb6073844526488b334408134e7c4662bd64e94e5cbd6b08f0e34ec3b734' 
  AND (
    token = '2phlmo3O1ac34LGRjkgEZDNO0zNz3gshm/1QhMOjRss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00115