UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGVw+wN9e2Z/ROGGTuuaGycrop/18HFV/g3BK2gB81E='
WHERE
key_id = '1ae9785120525ba07131c83dd692ec768f0ca5918e313ce572ff69e13694017c'
AND (
token = 'QGVw+wN9e2Z/ROGGTuuaGycrop/18HFV/g3BK2gB81E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)