We study the transport of self-propelled particles in dynamic complex environments. To obtain exact results, we introduce a model of run-and-tumble particles (RTPs) moving in discrete time on a d-dimensional cubic lattice in the presence of diffusing hard-core obstacles. We derive an explicit expression for the diffusivity of the RTP, which is exact in the limit of low density of fixed obstacles. To do so, we introduce a generalization of Kac's theorem on the mean return times of Markov processes, which we expect to be relevant for a large class of lattice gas problems. Our results show the diffusivity of RTPs to be nonmonotonic in the tumbling probability for low enough obstacle mobility. These results prove the potential for the optimization of the transport of RTPs in crowded and disordered environments with applications to motile artificial and biological systems.