Deal would result in 30-year term for sex offender