I see. I was doing something similar recently and struggled to find a way to do so. I ended up storing the actual value of the qr-code and just re-assigned that value to it on reboot. That spawned a new qr but with the same info embedded in it.
That approach was fine for my needs, but probably not in your case.