update xf_thread
join xf_post on xf_post.post_id = xf_thread.first_post_id
set xf_thread.post_date = xf_post.post_date
where xf_thread.post_date <> xf_post.post_date;
update xf_thread
join xf_post on xf_post.post_id = xf_thread.last_post_id
set xf_thread.last_post_date = xf_post.post_date
where xf_thread.last_post_date <> xf_post.post_date;