I'm confused. Did they believe that by living well, they would change God's mind in the past?
Yes, you are confused, because you recognise on the one hand that according to Calvinism the doctrine of Predestination removes the idea that salvation is not based on meritorious works, but then you seem to think that good works must be motivated by a desire to be saved by them. Clearly that is not what Calvinism thought or taught.
I'd encourage you to look at some of the historic confessions in the Calvinist tradition. Here's a translation of the Canons of Dort (1618/19), and here's the 2nd Helvetic Confession (1564).
Particularly look at the sections on election, and on good works. In the 2nd Helvetic, scroll down to Chapter 16 and we read the following:
These same works ought not to be done in order that we may earn eternal life by them, for, as the apostle says, eternal life is the gift of God. Nor are they to be done for ostentation which the Lord rejects in Matt., ch. 6, nor for gain which he also rejects in Matt., ch. 23, but for the glory of God, to adorn our calling, to show gratitude to God, and for the profit of the neighbor.
Here we see four explicit purposes for doing 'good works', or living out the Christian life as they saw it:
That's how Calvinism expresses the motivation to live godly lives. Predestination was not a doctrine that encouraged "do whatever, you are going to heaven anyway", it was part and parcel of a system that very strongly emphasised the fruits of repentance and regeneration in the life of believers.