UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '93ScW/QBCCIDyiegQkFAr6cA2ztirVETsr5PqsjidB4='
WHERE
key_id = '67ae40acf104d588a6f9f1390880c229e8e48fd2465626c00b16840c4ccd9f9e'
AND (
token = '93ScW/QBCCIDyiegQkFAr6cA2ztirVETsr5PqsjidB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)