UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3o4tSMd6SEXIsNKmscfvgJQmQHl7o9zmZxz1PAnSQUM=' 
WHERE 
  key_id = '42ad4e3b9f2b47413e62f936dea91e244e49ed2801e6076e15d6ec963e3a6c95' 
  AND (
    token = '3o4tSMd6SEXIsNKmscfvgJQmQHl7o9zmZxz1PAnSQUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036