For some reason w3tc disables the checkboxes when CloudFront cdn is selected in the cdn options. Even if the cdn option itself is off.
So a solution is to change the cdn type to some other besides CloudFront and the checkboxes are enabled again.
This solution works. after changing the CDN type clear all cache and then set expires header option gets enabled. Thanks to solution from fuflo.