  In this paper, for an arbitrary Kac-Moody Lie algebra $\mathfrak g$ and a
diagram automorphism $\mu$ of $\mathfrak g$ satisfying certain natural linking
conditions, we introduce and study a $\mu$-twisted quantum affinization algebra
$\mathcal U_\hbar\left(\hat{\mathfrak g}_\mu\right)$ of $\mathfrak g$.
  When $\mathfrak g$ is of finite type, $\mathcal U_\hbar\left(\hat{\mathfrak
g}_\mu\right)$ is Drinfeld's current algebra realization of the twisted quantum
affine algebra. When $\mu=\mathrm{id}$ and $\mathfrak g$ in affine type,
$\mathcal U_\hbar\left(\hat{\mathfrak g}_\mu\right)$ is the quantum toroidal
algebra introduced by Ginzburg, Kapranov and Vasserot. As the main results of
this paper, we first prove a triangular decomposition for $\mathcal
U_\hbar\left(\hat{\mathfrak g}_\mu\right)$. Second, we give a simple
characterization of the affine quantum Serre relations on restricted $\mathcal
U_\hbar\left(\hat{\mathfrak g}_\mu\right)$-modules in terms of "normal order
products". Third, we prove that the category of restricted $\mathcal
U_\hbar\left(\hat{\mathfrak g}_\mu\right)$-modules is a monoidal category and
hence obtain a topological Hopf algebra structure on the "restricted
completion" of $\mathcal U_\hbar\left(\hat{\mathfrak g}_\mu\right)$. Last, we
study the classical limit of $\mathcal U_\hbar\left(\hat{\mathfrak
g}_\mu\right)$ and abridge it to the quantization theory of extended affine Lie
algebras. In particular, based on a classification result of
Allison-Berman-Pianzola, we obtain the $\hbar$-deformation of all nullity $2$
extended affine Lie algebras.
