UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nkXNP0bvGmrTPS9SERZzlxBhfh9yqRwFzaDU50eAsNc='
WHERE
key_id = '7ad23836ebd649edfee515b450b5a19ff5f8fe6dbf4652096f0afa1d7f1631e5'
AND (
token = 'nkXNP0bvGmrTPS9SERZzlxBhfh9yqRwFzaDU50eAsNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)