You have to recompile with the newer version. If you want to replace it (e.g. 5.4.12 with 5.4.13) make sure to have same "provides" name.
E.g. use php-5.4 rather than php-5.4.12 (otherwise they will get installed side by side).
On the other hand, you could install every version by it's own (I do it like this) and switch from within ISPConfig.