This is not true. Let $E$ be an elliptic curve over $\mathbb{R}$, such that $E(\mathbb{R})$ has one connected component. Let $u$ be a point of $E(\mathbb{C}) \setminus E(\mathbb{R})$. Writing $\sigma$ for complex conjugation; $u + \sigma(u)$ is in $E(\mathbb{R})$. Two of the solutions to $2v=u + \sigma(u)$ are real and the other two are complex conjugate to each other; let $v$ and $\sigma(v)$ be the complex conjugate pair. So
$$2v=2\sigma(v) = u + \sigma(u)$$
in the group law of $E$.
Now, let $X = E \setminus \{ v, \sigma(v) \}$ and consider the line bundle $L:=\mathcal{O}(u + \sigma(u))$. Since this is a $\sigma$ invariant divisor, the line bundle $L$ is defined over $\mathbb{R}$. I claim that $L$ is nontrivial, but becomes trivial after base extending to $\mathbb{C}$.
Proof that $L$ is nontrivial: If not, there would be a real function $f$ on $X$, with zero divisor precisely $u + \sigma(u)$. Extending to a meromorphic function on $E$, we would have $$u + \sigma(u) = k v + (2-k) \sigma(v).$$ But, since $f$ is $\mathbb{R}$$\sigma$ invariant, it has poles of the same order at $v$ and $\sigma(v)$, so $u + \sigma(u) = v + \sigma(v)$. Using the linear relation $u + \sigma(u) = 2v$, we deduce that $v = \sigma(v)$, contradicting that $v$ was chosen not to be real.
Proof that $L \times_{\mathbb{R}} \mathbb{C}$ is trivial: The relation $u + \sigma(u) = 2v$ means there is a meromorphic function on $E$ with zeroes at $u$ and $\sigma(u)$, and a double pole at $v$. Restricting this function $X$, we get a trivialization of $L$.