UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KpEgIAKiSC08DfSjrVdTDimyfrxQsFJmg5Suc4Mzj5s='
WHERE
key_id = '4c08bf0d865a4c68f685ed7326016aa85e06b002fd30d9dca5fcfba5f463f9eb'
AND (
token = 'KpEgIAKiSC08DfSjrVdTDimyfrxQsFJmg5Suc4Mzj5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)