For a domain $D$, let $D^\times$ be the group of units and denote $D^\bullet:=D\setminus\{0\}$. Then the monoid $D^\bullet/D^\times$ is ordered by divisibility, and encodes the associates classes (sets of elements that are associate, i.e. equal up to multiplication by units) of $D$.
Atoms in $D^\bullet/D^\times$ correspond to (associates classes of) irreducible elements in $D$, not primes, but a bit of commutative algebra removes the distinction (logically, not conceptually) for what we have planned. Specifically, as $D$ is GCD iff $D^\bullet/D^\times$ is lattice-ordered and $D$ is FFD iff $D^\bullet/D^\times$ is locally finite (both essentially by definition), we can employ the following lemma:
$\quad$ Lemma. $~$ A domain $D$ is a UFD $\iff D$ is GCD and atomic.
Now we may conclude the following order-theoretic characterization of unique factorization:
$\quad \sf \color{Blue}{Theorem}.~$ A domain $D$ is a UFD $\iff$ $D^\bullet/D^\times$ is a locally finite lattice.
Note that factorization into primes (elements $p$ such that $p\mid ab\Rightarrow p\mid b$ or $p\mid b$) is always unique up to order and multiplicity, the only issue is that sometimes elements don't have factorizations into primes. On the other hand, many (not all) domains always have factorizations into irreducible elements, for instance number rings or Dedekind domains, but not uniquely. Primes are irreducible, but not conversely in general. In the presence of the GCD property, all primes are irreducible.
Proof of lemma. ($\Rightarrow$) Suppose $D$ is a UFD. Then every element is factorable into primes, which are irreducible. Every associates class of element can be identified with a multiset of primes (the correspondence is given by factorization in one direction and multiplication in the other). The gcd and lcm of two elements can be computed as the intersection or union of multisets as appropriate, or by taking minimums in prime exponents in their prime factorizations. ($\Leftarrow$) Suppose $D$ is a GCD domain and $p\in D$ is prime. Suppose $p=ab$ is reducible with $a,b$ nonunits. Then $p\mid a$ or $p\mid b$ by primality, wlog $p\mid a$, so $a=pc\Rightarrow p=ab=pbc\Rightarrow 1=bc$ tells us $b$ was a unit, a contradiction, hence all primes are irreducible. If further $D$ is atomic, then all elements admit a factorization into irreducibles which is a factorization into primes, which is necessarily unique.
Proof of $D$ FFD $\Leftrightarrow D^\bullet/D^\times$ locally finite: a poset $P$ with least element $l$ is locally finite (all intervals $[a,b]$ are finite) iff the intervals $[l,b]$ are all finite.
Proof of theorem. If $D^\bullet/D^\times$ is a locally finite lattice then $D$ is an FFD and a GCD. If $D$ is an FFD then it is atomic, so atomic+GCD imply $D$ is a UFD. Conversely if $D$ is a UFD then it is GCD hence $D^\bullet/D^\times$ is a lattice, and it is a FFD since primes are irreducible and any divisor of an element must have factorization into the same primes as that element only with lesser or equal multiplicities.
$\quad\sf\color{Blue}{Definitions}$:
A partially ordered set is a lattice if every two elements have a least upper bound and greatest lower bound. It is atomic if every element is greater than some atom. At atom is an element that covers a least element. A least element is a unique minimum element. A minimum element is one which has no elements below it. An element covers another if it's greater than the other and there are no elements between them. A poset is locally finite if every interval is finite. An interval is the collection of all elements between two given ones.
A ring $D$ is a domain if it is commutative and unital (has a multiplicative inverse $1\in D$) and has no zero divisors (elements $a,b$ such that $ab=0$). Domains have cancellation, that is $ax=bx$ always implies $x=0$ or $a=b$. A unit is a multiplicatively invertible element. An element is called reducible if it is the product of two nonunits, else it is irreducible. An element is prime if whenever it divides a product of elements, it divides one of the factors.
A domain $D$ is a unique factorization domain, abbreviated UFD, if all elements have factorizations into primes. A domain $D$ is a GCD domain if any two elements have a greatest common divisor (with the divisibility order) up to multiplication by units. Two elements are associate if one is the other times a unit. A domain $D$ is called a finite factorization domain (FFD) if every element has a finite number of divisors counted up to association.