Assuming that no key or value contains embedded `|` or `=` characters:
awk 'BEGIN { ORS = RS = "|"; OFS = FS = " =" }{ gsub(" ", "", $1) }; NF > 1' file
This treats the input as a set of `|`-delimited records. Each record uses ` =` (space+`=`) as the field delimiter.
For each record, the spaces in the first field (your keys) are deleted using `gsub()`. If the current record has more than a single field, it is then printed (this is tested to avoid outputting an empty record at the end).
There is no newline at the end of the output.
I'm unfortunately unable to test this on AIX, but I don't think it uses any non-standard `awk` features.