Thank you for your advice! I think I can do it even more simply: Before the time loop, I create list of the dofs which need to be set on the slip boundary, and in each time step I loop just over this list and set the respective dofs.
Best wishes, Henry