UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ns+hIGZxwuSi1qo1safzPLTVJmyvX/6oPRQHdhHFEuY='
WHERE
key_id = '641ecb95a4ce5d9a9da399324e8c1144bfa3b6709e56cf02681e14e6f6ae7f8b'
AND (
token = 'ns+hIGZxwuSi1qo1safzPLTVJmyvX/6oPRQHdhHFEuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)