This is correct. I would phrase this in terms of group actions, although it sounds like my argument is pretty much the same as yours. Let the underlying set be $M=\{1,x,y\}$. Every unital magma with $3$ elements is isomorphic to a unital magma with underlying set $M$ and $1$ being the unit by appropriately labeling the elements. The number of unital magma structures on $M$ is the number of maps $\{x,y\}\times\{x,y\}\rightarrow M$ (cause the rest of the multiplication is determined by the unit axiom and there are no further restrictions), of which there are $3^{2\cdot2}=81$ many. To determine how many of these are isomorphic, note that an isomorphism of unital magmas necessarily preserves the unit, so the only possible isomorphism is always given by the involution $\tau\colon M\rightarrow M$ that fixes $1$ and switches $x$ and $y$ (and every multiplication determines one that is isomorphic to it via $\tau$ by transport of structure, i.e. $m\mapsto\tau\circ m\circ(\tau\times\tau)$).
Thus, we obtain that $\mathbb{Z}/2\mathbb{Z}$ acts on the set of unital magma structures on $M$ and the isomorphism classes of such structures are precisely the orbits of this action. The condition that a unital magma structure is a fixed point of this action is equivalent to $\tau(x^2)=y^2$ and $\tau(xy)=yx$, so two of these products can be arbitrarily specified and the other two are then uniquely determined, meaning there are exactly $3^2=9$ such unital magma structures. This yields the overall number of orbits as $9+\frac{81-9}{2}=45$.