convert time in seconds to HH:MM:SS format in MySQL?

You can use MySQL function SEC_TO_TIME(). Example: SELECT SEC_TO_TIME(2378); Output is: 00:39:38  

Read more