The specific objective of the present work study is to propose an anisotropic slip boundary condition for three-dimensional (3D) simulations with adjustable streamwise and spanwise slip length by the discrete unified gas kinetic scheme (DUGKS). The present boundary condition is proposed based on the assumption of nonlinear velocity profiles near the wall instead of linear velocity profiles in a unidirectional steady flow. Moreover, a 3D corner boundary condition is introduced to the DUGKS to reduce the singularities. Numerical tests validate the effectiveness of the present method, which is more accurate than the bounce-back and specular reflection slip boundary condition in the lattice Boltzmann method. It is of significance to study the lid-driven cavity flow due to its applications and its capability in exhibiting important phenomena. Then, the present work explores, for the first time, the effects of anisotropic slip on the two-sided orthogonal oscillating micro-lid-driven cavity flow by adopting the present method. This work will generate fresh insight into the effects of anisotropic slip on the 3D flow in a two-sided orthogonal oscillating micro-lid-driven cavity. Some findings are obtained: The oscillating velocity of the wall has a weaker influence on the normal velocity component than on the tangential velocity component. In most cases, large slip length has a more significant influence on velocity profiles than small slip length. Compared with pure slip in both top and bottom walls, anisotropic slip on the top wall has a greater influence on flow, increasing the 3D mixing of flow. In short, the influence of slip on the flow field depends not only on slip length but also on the relative direction of the wall motion and the slip velocity. The findings can help in better understanding the anisotropic slip effect on the unsteady microflow and the design of microdevices.