UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGHaXIbv6A3vldwLYs++G4cE8wGNf0FhR4ACOJvM8uA='
WHERE
key_id = 'e689d0c88e61dda84418dde23365401a3440215cf6038691020a4dc5199fa7a2'
AND (
token = 'WGHaXIbv6A3vldwLYs++G4cE8wGNf0FhR4ACOJvM8uA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)