Upvote:8
The Schengen clock starts ticking on the day (not the second) you enter the Schengen area, other than a country you have a valid long-stay visa for.
It does not get reset by reentering the Schengen area.
If you have been in the Schengen area for 40 days since July 10, you now only have 50 days left to be in the Schengen area until and including January 5 2018 (which is when the 180 day period that started July 10 will end).
There is no way to change that, short of somehow getting a long-stay visa or residence permit from the Schengen country you want to spend additional days in. Which way you travel doesn't matter.