UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QLKxdQUQAVVmHay4UhQCceOfAXA+e0en35e14MvgAwE='
WHERE
key_id = '8334ff800e27f5740be38e6a1006f7bc7627592e96fd4592e909939791142836'
AND (
token = 'QLKxdQUQAVVmHay4UhQCceOfAXA+e0en35e14MvgAwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)