UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/I+e//uQNXtPJ8LmqXths65cRsVEeiF5ih0RKwo6VY4='
WHERE
key_id = '2d5d80a28c8dcd7d31bf0ecd9c85f93709cffe37adf35206cb569226151c5ba9'
AND (
token = '/I+e//uQNXtPJ8LmqXths65cRsVEeiF5ih0RKwo6VY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)