Yes, but you will need to use webcore. And that means it will have to run in the cloud. . This is a very sophisticated rules engine created by the community. It allows for stacked conditionals like “if A then B, unless C, but only if D.” And motion sensor lighting combined with manual switches is one of their most popular uses.
Set up is pretty complicated, but there are a lot of community members who will be glad to help. They even have their own forum.
However, there are no locally operated methods for doing this with SmartThings, unfortunately.
If you want to look into webcore, see the following
If you really need to have totally local operation, then your best choice may be just to have the lights come on with the motion sensor, and set up a separate rule that turns them off at a specific time of day in case you forget to turn them off with the switch. But don’t set up a rule to have that particular area turn lights off because of inactivity on the motion sensor. It’s not perfect, but it may be good enough depending on the details.