UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '89o/QeBXlVsduli0RvpLCO+r+VmrxBbl8WntEF3+NhQ='
WHERE
key_id = '3de60c78c5fa809826f736fda3326bece6f950fae272e10fdb6abf4a77cfad7d'
AND (
token = '89o/QeBXlVsduli0RvpLCO+r+VmrxBbl8WntEF3+NhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)