UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vSZMq+NuWI18IchAP1QLrYxPHL5ZBh+NKYzW4LraS4I='
WHERE
key_id = '5f9b94536152f03cf93f6314073793a3d7816f9f27cf1c320c93623342e56d44'
AND (
token = 'vSZMq+NuWI18IchAP1QLrYxPHL5ZBh+NKYzW4LraS4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)