UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3zan8ZwMLcm5NjrHTVQt7HrlFfMc04AarssntjYWNaQ='
WHERE
key_id = 'cbc9b8874cfc365186da57193c1200be7756a18fe62bf80d9bac69ead52b66bb'
AND (
token = '3zan8ZwMLcm5NjrHTVQt7HrlFfMc04AarssntjYWNaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)