UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i/8wtdKn57jSW1dLiURjahq9TAnbC5cz3fjrffrXkrQ=' 
WHERE 
  key_id = '8732430fc379425a37cddbdef7b6dd576f56287cd6665a77216a4ecd2e25b6a5' 
  AND (
    token = 'i/8wtdKn57jSW1dLiURjahq9TAnbC5cz3fjrffrXkrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022