In the United States a criminal law that seeks to increase the punishment for an act after the fact is called an ex post facto law.
The United States Constitution bans ex post facto laws. The clause that bans the federal government from this is clause 3 of Article I, Section 9 of the United States Constitution. The states cannot create ex post facto laws due to clause 1 of Article I, Section 10.
If this new legislation is updated and it increases the punishment it cannot apply retroactively, thus the case continues by the old laws.
If this new law reduces the punishment or adds a non-punitive consequence of violating the law, the new law takes effect when the law is passed. An example of a non-punitive consequence is the addition of a second registration requirement to sexual offenders ex post facto. Since this does not serve to punish them, but simply keep the public safe, there is no prohibition against such a requirement. Additionally, legislation cannot remove procedural requirements retroactively. Old rape statues dictated a conviction cannot occur if the only evidence is the testimony of the victim. This was eventually repealed, but cannot be repealed ex post facto.
Most of the time in the United States legislature avoids this whole dilemma by specifying that the new law is in effect for crimes committed after it passed and the old one is in effect for crimes committed before this law passed.
In civil law there is no prohibition on ex post facto laws and the law takes effect in the manner it is specified to take effect. If the law changes during the trial, there will most likely be a new trial.