UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v5wiUXBnCO4iIaOazIkxjKI18XHWWsNFoKo2jcW+GoM='
WHERE
key_id = '469ff05e3d363a397e81f91fa1e3d3646444d76fbdc011bb700a360210446e2f'
AND (
token = 'v5wiUXBnCO4iIaOazIkxjKI18XHWWsNFoKo2jcW+GoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)