UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ke1VQ5VmhGpEDe31dFGlOig/Uz/idsZVLoUanUvpY/M='
WHERE
key_id = '91c13cddf6fe2b934a6d3db43361aed3a7680b7c821fc75ab5d79c0609028fcd'
AND (
token = 'ke1VQ5VmhGpEDe31dFGlOig/Uz/idsZVLoUanUvpY/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)