UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6aqDaCjgXjSsQxmSJwO/jrHTvyscyVQ/rVZh/sy6gBs='
WHERE
key_id = '61dcd399b421bb5df6c120823394d6b28c484e7a692ed4daef5f3439678042d2'
AND (
token = '6aqDaCjgXjSsQxmSJwO/jrHTvyscyVQ/rVZh/sy6gBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)