UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ye1LO5gw0G9xMUhVxiEJ2AF/kTG4wLXn+4JZnNa4Is=' 
WHERE 
  key_id = '700d7b4d21515e4f32981d685af598e745f91ec57d209a49a07ca363df37b862' 
  AND (
    token = '/ye1LO5gw0G9xMUhVxiEJ2AF/kTG4wLXn+4JZnNa4Is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035