I have read that America "opening" the country, by demonstrating their military superiority and negotiating vastly unfair treaties was the main cause of the restoration. But I also wanted to know, whether civil unrest due to mismanagement by the Shogunate and their Daimyou was a cause of the conflict. I suspect that the movement was a combination of both but I do not know whether there was enough cause for unrest even before 1853 to be significant and why it was thought to be better to reinstate the emporer and do away with the shogun during the Bakumatsu.
TL;DR: Why did they reinstate the emperor? And was there enough civil unrest before 1853 for it to be relevant to the overthrowing during the Bakumatsu?
To be very blunt, while it is impossible to say if or when the Edo Bakufu would have otherwise fallen, it is clear it would not have fallen when it did if the western powers did not force Japan open and do it in the manner they did.
For sure, the Bakufu was far from perfect and did face some internal unrest. The west actually caught the Bakufu at a very bad time, for Japan was just recovering from the Tenpō famine of the late 1830s, the one of if not the larges famine of the Edo era. Like any other place or time in history, famine lead to social unrest, and Japan also saw quite a number of peasant riots. The Bakufu was also right in the midst of a succession crisis when the west showed up, the cause of which certainly couldn't be placed on the western powers. And there were definitely previous attempts of members of the Kyōto court to reassert themselves.
However, first we need to keep in mind what brought down the Bakufu. The most immediate is western merchants to supply Chōshu and Satsuma with modern weapons that brought them victory in the Second Chōshu Expedition and the battle of Toba-Fushimi. The Bakufu commanders gave a very poor showing of themselves, for sure, but it's quite hard to imagine Satsuma and Chōshu defeating forces many times their size without modern rifles and artillery. The treaties of with the western powers also imposed on threat of war that Japan was to bring its currency in line with the wider market. Japan at the time exchanged it's gold to silver on a value of roughly 1:5, while the world market was 1:15. This lead to speculation and forced the Bakufu to rework its entire currency to stop the speculation. At the same time there was a huge outflow of Japanese goods from increased exports, leading to shortages. This coupled with currency chaos from the Bakufu reworking its currency to domains all over Japan issuing their pseudo-currency to meet increased cost as domains frantically tried to re-arm for war lead to hyperinflation. There are quite a few studies that suggest this (and the following short war) lead to one of if not the largest drop in real income in the Edo period, at least on-par with the worst famines of the Edo period if not even larger. And having compiled some numbers myself these past few months I certainly agree with those findings. And of course the whole reason that the Bakufu became a target to be overthrown in the first place is because it was seen as weak and unable to protect Japan against the western powers, a sentiment no doubt reinforced by the economic chaos caused by the treaties the powers imposed on the Bakufu.
Let's look at the problems faced by the Bakufu before the western powers showed up. The Bakufu had sorted out succession crisis in 1704 and 1716. While the factional lines drawn during the succession crisis of 1857 would probably have been drawn regardless of the coming of the west, it's hard to see how that could have lead to political purges which ended up with Ii Naosuke's assassination in 1860 without all the flak the Bakufu took from its handling of the west. Attempts by Emperor Reigen in the late 17th and members of the court in the mid and late 18th century to be more assertive were easily checked because the Bakufu both controlled the purse strings and had men in Kyōto to watch over things and importantly unlike in the Bakumatsu no domain supported Kyōto because there was no other turmoil. The Bakufu also survived through four major and countless minor famines, including the cold weather and crop failures that brought down the French Monarchy in the late 1780s. Remember the peasant riots I mentioned that accompanied the Tenpō famine? They involved a few hundred peasants at most. Ōshio Heihachirō's in March of 1837 was over in a month and all but the first couple of days were spent trying to find the perpetrators who had gone into hiding. Ikuta Yorozu was likewise crushed as soon as it started. The largest that engulfed Kai province was crushed in about 10 days. Reinforcement sent by nearby Suwa Domain did not even reach the effected locations in time to do any fighting. There's a clear difference when compared with China with the White Lotus Rebellion that took eight years to crush, or the Eight Trigrams uprising in 1813 that despite being close enough to Beijing for the rebels to launch a surprise assault on the imperial palace still took three months of fighting to crush. And importantly, rioting peasants during famines in Edo era Japan had no official support from any domain.