Which isomorphism of coordinate rings corresponds to isomorphisms of affine varieties? Consider the following claim:

Let $X \subset k[x_1,\dots,x_n]$ and $Y\subset k[y_1,\dots,y_m]$ be algebraic sets and suppose that we have a ring isomorphism $\varphi: \mathcal{O}_Y \to \mathcal{O}_X$. Show that the algebraic sets $X$ and $Y$ are isomorphic.

Now, I know that if $\varphi$ is an isomorphism of $k$-algebras, then $X$ and $Y$ are isomorphic. And I know that any isomorphism of $k$-algebras is also an isomorphism of the underlying rings.
Question: However, isn't it the case that not every ring homomorphism $\varphi: \mathcal{O}_Y \to \mathcal{O}_X$ is a $k$-algebra homomorphism $\mathcal{O}_Y \to \mathcal{O}_X$, and that only $k$-algebra homomorphisms $ \mathcal{O}_Y \to \mathcal{O}_X$ correspond to morphisms $X \to Y$, not arbitrary ring homomorphsims $\mathcal{O}_Y \to \mathcal{O}_X$?
In other words, which of the following two statements are correct? Are they even mutually exclusive? Or are they equivalent? If they are equivalent, why?

Two algebraic sets are isomorphic if and only if their coordinate rings are isomorphic as rings.

OR

Two algebraic sets are isomorphic if and only if their coordinate rings are isomorphic as $k$-algebras.

Context: My book, in sections 4.18 and 4.19, as well as this question on Math.SE implies that the first statement is true. However, section 4.8 of the same book, and every other source I have found (e.g. here or here), implies only that the second statement is true. Moreover, I was only able to prove the second statement, not the first. Which is correct?
This is a follow-up to my previous question, an attempt to show that the two statements are mutually exclusive and not equivalent. It was unanswered though, so I don't know if my attempt was successful -- for all I know, the two statements could be equivalent. If so, why?
EDIT: What I showed in my notes, and was agreed to be true in the comments is that:

There is a one-one correspondence between morphisms $X \to Y$ and ring homomorphisms $\mathcal{O}_Y \to \mathcal{O}_X$. (FALSE)
There is a one-one correspondence between morphisms $X \to Y$ and $k$-algebra homomorphisms $\mathcal{O}_Y \to \mathcal{O}_X$. (TRUE)

 A: Attempt: The anti-equivalence of $k$-algebras and affine varieties (1)(2 pp.3-4), gives us automatically that: 

Two algebraic sets are isomorphic if and only if their coordinate rings are isomorphic as $k$-algebras. (TRUE)

Now, note that, since any $k$-algebra homomorphism is a ring homomorphism when we ignore scalar multiplication, any $k$-algebra isomorphism is also a ring isomorphism, so the above implies that:

$$\text{[two algebraic sets isomorphic }\iff\text{ coordinate rings $k$-algebra isomorphic]}\\ \implies \text{[coordinate rings are ring isomorphic]}$$

So the only real remaining question is the following:

[coordinate rings are ring isomorphic] $\overset{?????}{\implies}$[coordinate rings are $k$-algebra isomorphic]

According to the comments, this might be true, since given a ring homomorphism, we might always be able to "twist" it (I guess under the action of the Galois group of $k$) into being a $k$-algebra homomorphism. Any references confirming or denying this would be appreciated. (See also.) So would comments on my faux proof of this claim below.
"Proof" of ?????: Generalizing from coordinate rings to arbitrary associative unital algebras, we can write (see for notation) the condition for a ring homomorphism $A \to B$ to also be a $k$-algebra homomorphism as $\varphi \circ \eta_A = \eta_B$. Now assume that $\varphi: A \to B$ isn't a $k$-algebra homomorphism, but still a ring isomorphism, i.e. $\varphi \circ \eta_A \not= \eta_B$. Since $\eta_A(k)$ is a field, and $\varphi |_{\eta_A(k)}$ is a ring homorphism with a field as its domain, it is injective, and thus $\varphi(\eta_A(k))$ is also a field isomorphic to $k$, albeit a different from $\eta_B(k)$ (they would be the same if $\varphi$ were a $k$-algebra homomorphism).
To summarize, $k \cong \eta_A(k) \cong \varphi(\eta_A(k)) \cong \eta_B(k)$, with none of them equal (just isomorphic as fields/rings). Define: $$ \DeclareMathOperator*{\rl}{\rightleftharpoons} k \rl\limits_{\Upsilon^{-1}}^{\Upsilon} \eta_A(k)\,, \quad k\rl\limits_{\theta^{-1}}^{\theta} (\varphi\circ\eta_A)(k)\,, \quad k \rl\limits_{\zeta^{-1}}^{\zeta} \eta_B(k)\,, \quad \eta_A(k) \rl\limits_{\omega^{-1}}^{\omega} \eta_B(k)$$
It follows that $\theta^{-1} \circ \varphi \circ \Upsilon$ and $\zeta^{-1} \circ \omega \circ \Upsilon$ are two different automorphisms of $k$, since $\varphi \circ \eta_A \not=\eta_B$. (In particular, if $k$ had trivial Galois group, we would have a contradiction, thus if $k$ has trivial Galois group, every ring homomorphism $A \to B$ is also a $k$-algebra homomorphism.)
(I'm not really sure if $\varphi \circ \eta_A \not= \eta_B$ actually implies that the two automorphisms above are not equal, if it does, then I am skipping the step that justifies the claim, and if it doesn't, then the above is the point where the entire argument falls apart.)
For simplicity, we will define $\alpha = \theta^{-1} \circ \varphi \circ \Upsilon : k \to k$ and $\beta= \zeta^{-1}\circ \omega \circ \Upsilon : k \to k$.
Speculative claim: Define $\tilde{\varphi} = \zeta\circ\beta\circ\alpha^{-1}\circ\theta^{-1}\circ\varphi|_{\eta_A(k)} : \eta_A(k) \to \eta_B(k) $. 
Then $\tilde{\varphi} \circ \eta_A = \eta_B$. (Really speculative) $\tilde{\varphi}$ can have its domain extended to all of $A$, and denoting the extension by the same symbol, we have that $\tilde{\varphi}: A \to B$ is not just a ring homomorphism, but even a $k$-algebra homomorphism (since $\tilde{\varphi} \circ \eta_A = \eta_B$). Moreover I claim (without justification) that if $\varphi$ is a ring isomorphism, then $\tilde{\varphi}$ is a ring isomorphism as well, thus a $k$-algebra isomorphism.
Thus we are able to "twist" any arbitrary ring homomorhpism $\varphi: A \to B$ via the action of the automorphism/Galois group of $k$ into a $k$-algebra homomorphism $\tilde{\varphi}:A \to B$, in such a way that the existence of a ring isomorphism $A \to B$ implies the existence of a $k$-algebra isomorphism $A \to B$.
Therefore, [coordinate rings ring isomorphic] $\implies$ [coordinate rings $k$-algebra isomorphic].
