I would recommend to use the full path to the PHP 5.4 for the cron job, e.g.
/usr/bin/php54 /home/xxx/.../api/cron.php
I guess the cron job is executed with an older PHP version because there is a difference between the PHP version and also the config which is used by apache and by cli! To avoid this, just specify the full path to the correct PHP 5.4 ;)