convert_unixtime output wrong date
Use TIMESTAMP, not DATETIME.  Then set each client to the timezone where it resides, or to UTC for the main server.

That way, the conversions will be done automatically.  That is, no conversion code is needed.