Catalyzes the NAD-dependent oxidation of beta-hydroxybutyryl-CoA to acetoacetyl-CoA in vitro at pH 10. Also catalyzes the reverse reaction albeit in a lower pH range of 5.5-6.5. The reverse reaction is able to use NADPH as well as NADH. 3-hydroxybutanoyl-CoA + NAD(+) = acetoacetyl-CoA + H(+) + NADH (3S)-3-hydroxybutanoyl-CoA + NADP(+) = acetoacetyl-CoA + H(+) + NADPH Activated by magnesium and calcium, and inhibited by zinc, nickel and cobalt. Optimum pH is 10. Optimum temperature is 37 degrees Celsius. Lipid metabolism; butanoate metabolism. Up-regulated upon acid shock and SDS stress. Belongs to the 3-hydroxyacyl-CoA dehydrogenase family.