UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9UTWSKtME3yDmM9LzH2TBuBDwR5u0dMsH5rfWVVXW88='
WHERE
key_id = '4b63cbbc27f54f605eb681be1d3cebd50e68dbd36026549114c7bb95bacd2e33'
AND (
token = '9UTWSKtME3yDmM9LzH2TBuBDwR5u0dMsH5rfWVVXW88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)