Lattice real-time simulations with learned optimal kernels