UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TkdmErwFWls7uaRwOgKsRxa7+/8kC3IkEW4J5kBj49c=' 
WHERE 
  key_id = 'b98721f2124c623bd191da24610ef67bf1f4d89bda5750ebdf70c9ed39ddf31e' 
  AND (
    token = 'TkdmErwFWls7uaRwOgKsRxa7+/8kC3IkEW4J5kBj49c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022