UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X431JJhyGFPVGARmv8WjkzmJLIvx6dhrJGJ10bI1u0w='
WHERE
key_id = 'df027a5a8a8fbd271fba0e349a63e0dc52cbddc95a475ff32f9dfe67c53d057a'
AND (
token = 'X431JJhyGFPVGARmv8WjkzmJLIvx6dhrJGJ10bI1u0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)