UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZpTiIoBFJ4M0RACWaTMOCHCt2skcbg5/WbZflbg3ino='
WHERE
key_id = '7b0299be679ced5319f4dad8b4cff8c6b14fea73802bf6fd2504caacba1771b4'
AND (
token = 'ZpTiIoBFJ4M0RACWaTMOCHCt2skcbg5/WbZflbg3ino='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)