In the course of reading a paper , I've encountered the following property of interest.

If $R$ is a ring, say it satisfies (*) if: For any smooth, irreducible $R$-algebra $B$ of finite type such that all the fibers of $Spec B$ over points of codimension one in $Spec R$ are irreducible, then $(B \otimes_R K)^* = B^* K^*$, where $K$ is the fraction field of $R$.

The author remarks that it is easy to verify property ( * ) for UFDs. However, I don't see how to do this. What's a proof UFDs satisfy ( * )?

The application I'm interested in is actually where $R$ is a DVR. I feel that in this case, one should be able to give an even simpler argument.

Here is the motivation: we have some rational function $f$ on the generic fiber of an abelian scheme, so it's invertible away from its divisor $D$ on the generic fiber. We want to multiply $f$ by an element of $K^*$ to extend it to the complement over $\overline{D}$ on the entire abelian scheme.