UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MP372fbe1pKywiLIaxJWFGmoj3hFw4ubgQ0AWDF9TBw='
WHERE
key_id = '342d675cadd31e2d93bda2bd23daaef084eb3a7675bd3bed700046b58136f32f'
AND (
token = 'MP372fbe1pKywiLIaxJWFGmoj3hFw4ubgQ0AWDF9TBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)