Tunable spin-orbit coupling for ultracold atoms in two-dimensional optical lattices