UPDATE file_files
SET
  thumbnail_mime_type = NULLIF(TRIM(thumbnail_mime_type), ''),
  thumbnail_bucket = NULLIF(TRIM(thumbnail_bucket), ''),
  thumbnail_object_key = NULLIF(TRIM(thumbnail_object_key), ''),
  thumbnail_object_version = NULLIF(TRIM(thumbnail_object_version), ''),
  thumbnail_etag = NULLIF(TRIM(thumbnail_etag), '')
WHERE
  COALESCE(TRIM(thumbnail_mime_type), '') = ''
  OR COALESCE(TRIM(thumbnail_bucket), '') = ''
  OR COALESCE(TRIM(thumbnail_object_key), '') = ''
  OR COALESCE(TRIM(thumbnail_object_version), '') = ''
  OR COALESCE(TRIM(thumbnail_etag), '') = '';
