The calculation in local coordinates is not too hard and it works in any dimension $n$, namely if $c_1(M)=0$ then $\int_M c_2(M)\wedge\omega^{n-2}\geq 0$ for any Kahler metric $\omega$. Of course you are free to assume that the Kahler metric $\omega$ is Ricci-flat (by Yau's theorem), and in this case the integral is equal to the $L^2$ norm of the Riemann curvature tensor up to a factor.

To see this, let $\Omega_i^j=\frac{\sqrt{-1}}{2\pi} R^j_{i k\overline{\ell}}dz^k\wedge d\overline{z}^\ell$
denote the curvature form, then by Chern-Weil theory the form $Tr(\Omega\wedge\Omega)=\sum_{k,i} \Omega_i^k\wedge\Omega_k^i
=\frac{(\sqrt{-1})^2}{4\pi^2}R^k_{ip\overline{q}} R^i_{kr\overline{s}}dz^p\wedge d\overline{z}^q\wedge dz^r\wedge d\overline{z}^s$
represents $c_1^2(M)-2c_2(M)=-2c_2(M)$. You can assume that the metric $\omega$ is the identity at one point so $\omega=\sqrt{-1}\sum_i dz^i\wedge d\overline{z}^i$, and then at that point you compute
$$n(n-1)Tr(\Omega\wedge\Omega)\wedge\omega^{n-2}=\sum_{p\neq r}(R^k_{ip\overline{p}} R^i_{kr\overline{r}}-R^k_{ip\overline{r}} R^i_{kr\overline{p}})\omega^n$$
$$=\sum_{p,r}(R^k_{ip\overline{p}} R^i_{kr\overline{r}}-R^k_{ip\overline{r}} R^i_{kr\overline{p}})\omega^n$$
$$=(|\textrm{Ric}|^2-|\textrm{Rm}|^2)\omega^n=- |\textrm{Rm}|^2\omega^n.$$
Integrating this you get what you want, with equality if and only if $\omega$ is flat
and so $M$ is finitely covered by a complex torus.

A similar calculation works for any compact Kahler-Einstein manifold, and it can be used to prove the Miyaoka-Yau inequality for manifolds with ample canonical bundle. A reference for a general statement (I think this is not the earliest paper where this result appears) is:

Chen, Bang-yen; Ogiue, Koichi, Some characterizations of complex space forms in terms of Chern classes, Quart. J. Math. Oxford Ser. (2) 26 (1975), no. 104, 459–464.