With `awk`
awk 'FNR==NR{
a[">"$1]=$2;next
}
$1 in a{
sub(/>/,">"a[$1]"|",$1)
}1' file2 seq.fa
Get the scaf value from file2 and save it in an array `a` with index `">"$1`.
If `$1` of seq.fa is an index in array `a` substitute the `$1` to include the scaf value `a[$1]` after `>`.
Then print all lines in `seq.fa`