Unlawful use of weapons--exceptions--penalties. 571.030. 1. A person commits the crime of unlawful use of weapons if he or she knowingly:
...
(10) Carries a firearm, whether loaded or unloaded, or any other weapon readily capable of lethal use into any school, onto any school bus, or onto the premises of any function or activity sponsored or sanctioned by school officials or the district school board; or ...
3. Subdivisions (1), (5), (8), and (10) of subsection 1 of this section ... Subdivision (10) of subsection 1 of this section does not apply if the firearm is otherwise lawfully possessed by a person while traversing school premises for the purposes of transporting a student to or from school, or possessed by an adult for the purposes of facilitation of a school-sanctioned firearm-related event or club event. ...
4. Subdivisions (1), (8), and (10) of subsection 1 of this section shall not apply to any person who has a valid concealed carry permit issued pursuant to sections 571.101 to 571.121, ...
8. Unlawful use of weapons is a class D felony unless committed pursuant to subdivision (6), (7), or (8) of subsection 1 of this section, in which cases it is a class B misdemeanor, or subdivision (5) or (10) of subsection 1 of this section, in which case it is a class A misdemeanor if the firearm is unloaded and a class D felony if the firearm is loaded, ...