You could also use the fx operator to filter images based on height/width e.g.
identify -format '%[fx:(h>400 && w>400)]\n' image.png
will output 1 if the image is bigger than 400x400 and 0 if it's equal or smaller than 400x400...
Assuming sane files names (no newlines/spaces/tabs etc) you could use identify to print image names preceded by either 1: or 0:, process the output deleting lines that start with 0: and removing the leading 1: on the rest of lines so only the file names remain, one per line, then pipe that list to mogrify ... @- (the @ syntax was added in imagemagick v6.5.2):
identify -format '%[fx:(h>400 && w>400)]:%i\n' ./*.png | \
sed '/^1:/!d;//s///' | mogrify -resize '400x400' -- @-
Otherwise, with find you could print only the files with size > 400x400 and then pipe the result to xargs + mogrify (it's less efficient as it runs a shell for each file but it should work with all kind of file names):
find . -maxdepth 1 -type f -name '*.png' -exec sh -c \
'identify -format "%[fx:(h>400 && w>400)]\n" "$0" | grep -q 1' {} \; -print0 \
| xargs -0 mogrify -resize '400x400'
If you're a zsh user see also this answer.