UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RwJN/NMxtXQT0X12Ns6zcP2HfE23dC5Mwaf4zniN128='
WHERE
key_id = '2f7556d6875a162dfdd93fede06f2c809b65ea6a1bfc1aab9cecc3f1b3b49d17'
AND (
token = 'RwJN/NMxtXQT0X12Ns6zcP2HfE23dC5Mwaf4zniN128='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)