UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qlL3KyOccrc7Ma1iHoaZ51jlBOicN2sOd0GY4HcaOiw='
WHERE
key_id = '88f1a693859a725da80bf154df62073ae4afac7b1dcf6a401e32a3e48a21d35d'
AND (
token = 'qlL3KyOccrc7Ma1iHoaZ51jlBOicN2sOd0GY4HcaOiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)