It's the action, not the fruit of the action, that's important. You have to do the right thing. It may not be in your power, may not be in your time, that there'll be any fruit. But that doesn't mean you stop doing the right thing. You may never know what results come from your action. But if you do nothing, there will be no result.
The manner in which the Gita has solved the problem is to my knowledge unique. The Gita says, ‘Do your allotted work but renounce its fruit — be detached and work — have no desire for reward and work.
That we should obey laws whether good or bad is a new-fangled notion. There was no such thing in former days. The people disregarded those laws they did not like and suffered the penalties for their breach.