UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45kt4UZ66X2iJBBV8h5AI0KawPl4dXaFEZvxyh8ozFU='
WHERE
key_id = '01a812c422be1c5b2c4b6d4058415dc9d694d281855c3f7e98c9a3550234eaa7'
AND (
token = '45kt4UZ66X2iJBBV8h5AI0KawPl4dXaFEZvxyh8ozFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)