UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IM8/+INKQXE1/HUGOBgxnq2Mm1CGD5ZubjhK9gtkJLo='
WHERE
key_id = 'de3b9db20ec2b702d6e1ad020eb98c135a4eca7724d300b7fe7ea98cb062e3d3'
AND (
token = 'IM8/+INKQXE1/HUGOBgxnq2Mm1CGD5ZubjhK9gtkJLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)