UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8a6M6gl67eu0hYtym8KHMgR4QBXx4PurBXonoRnzHsk='
WHERE
key_id = 'a84cc45c896c5a3e5c441f8d3cf19c89079737ae1ad7fb2f1782d1f23ce6c3b8'
AND (
token = '8a6M6gl67eu0hYtym8KHMgR4QBXx4PurBXonoRnzHsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)