UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z4jLihkCKsOSxsFRJcdxlJzOPwwL7PbV9NDLAU9VeNI=' 
WHERE 
  key_id = '9db8b83b723df69ea7421597ae5556954feb1dcd7799131fa4c8f22683528026' 
  AND (
    token = 'z4jLihkCKsOSxsFRJcdxlJzOPwwL7PbV9NDLAU9VeNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065