Have done this many times, however, to KOA not to LIH. If things run smoothly, then 40 minutes is ok. However, if your flight is just 15 minutes late arriving in HNL...might not give you enough time. Further, don't know if I would be comfortable with CO transferring my luggage within 40 minutes if arrival into HNL.
If you missed your scheduled interisland flight b/c of a late CO arrival, HA or AQ are not obligated to do anything (They probably wouldn't leave you stranded, but they would not be required to do something).
I always book a 90 minute layover and try to find an agent who will let me fly standby on an earlier flight for no charge. Chances are my luggage made the earlier flight as well...