UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XyyFo2O4QybSyra+SK5F71ijWaFx7dHEEyyJwNZzHQU=' 
WHERE 
  key_id = '95bcbcf48e1930fb6a65f76a4b6d9da75c2fc14033530a9ffc12f0350ba4ce88' 
  AND (
    token = 'XyyFo2O4QybSyra+SK5F71ijWaFx7dHEEyyJwNZzHQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026