The ESP8266EX is an IC (a chip) and has 32 pins, an ESP-12 is a module which has an ESP8266 IC on it, along with some flash memory and other support components.
There are several ESP-12 modules: some have 16 pins, some have 22 pins: technically these modules are identical, the only difference is that the SPIHD pins are available on the 22 pin versions.
All ESP8266's use the same OS and can be flashed with the same homebrew firmware (eg. Arduino) if the flash memory is large enough, but with some modules (eg. an ESP-01) you only have physical access to a limited number of pins.
See more about the ESP (the single chip and
the modules) in
our Wiki-pages.
Because you're saying your module has 30 pins, I'm guessing you actually have a
NodeMCU, which is a development board built around an ESP-12.