UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AfLrsARsBcxwFtYCm0V3ttakVRVIlI1aWwlUGfdtrhw=' 
WHERE 
  key_id = '9280ba4da2e73cecf3f22435905773e9c319cfa9a35f4e288eced0a22990cf1a' 
  AND (
    token = 'AfLrsARsBcxwFtYCm0V3ttakVRVIlI1aWwlUGfdtrhw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034