UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2008-08-01' AND post_status = 'publish'