An explicit numerical scheme to efficiently simulate molecular diffusion in environments with dynamically changing barriers