UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2aXyG1phDhTYJQXdJWnyhqnuWIcCrQJyisPvkMdLDs0=' 
WHERE 
  key_id = '57a0cf375709ae4738fe0b2afe5f65aae30421f41752a4b946da04c2cbbb15d6' 
  AND (
    token = '2aXyG1phDhTYJQXdJWnyhqnuWIcCrQJyisPvkMdLDs0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025