UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qONsx7AfcjB+GYI6u+JTxnGqiF9hZsLun1oUGlMsbds='
WHERE
key_id = '2943931937572f818f90df35ede6ea95e41642675a16591a71c21876c2624c69'
AND (
token = 'qONsx7AfcjB+GYI6u+JTxnGqiF9hZsLun1oUGlMsbds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)