How to Update post_modified of all wordpress post

You can use a generalized update query. As always, when dealing with databases take a backup first.

With that out of the way, your query should look something like:

BEGIN; -- Start a transaction
UPDATE
  wp_posts
SET
  post_modified = <Your new date>
  AND post_modified_gmt = <Your new date in GMT>;

SELECT * FROM wp_posts LIMIT 10 ORDER BY post_date DESC; -- See the 10 most recently authored posts, make sure their post_modified and post_modified_gmt looks good

COMMIT; -- Commit the changes to the database or
ROLLBACK; -- If things don't look right.

Edit: in your case, if you do this in PHP, definitely take a backup, and then make $sql everything above except for the lines with BEGIN, COMMIT, and ROLLBACK, though I’d recommend doing this in the command line or a GUI/web interface.