The law itself is the main penal code of Germany and it is of course changed quite often. That specific provision has been unchanged since at least 1953 (though there has been a second subsection added). The original version from 1871 already contained it but worded differently.
The core of the laws is much older than the BRD, they were not re-invented from scratch after the war, rather re-established, actually. The penal code goes back to 1871 for Germany as a whole and is based on the earlier Prussian penal code of 1851.