Yes, and the assumption that $X$ is affine is unnecessary. Let $X$ be a Noetherian scheme, which we may assume is nonempty. By Noetherian induction, we may assume the result is known for every closed proper subscheme of $X$. Let $X_1,\dots,X_n$ be the irreducible components of $X$ and let $U=X\setminus (X_2\cup \dots\cup X_n)$. Then $U$ is open in $X$ and dense in $X_1$ and hence irreducible. Let $V$ be any nonempty affine open subset of $U$, which will still be irreducible. By the induction hypothesis, we can decompose $X\setminus V$ as a finite union of irreducible locally closed affine subschemes. Adding $V$ to this decomposition, we get a decomposition of $X$.