Isis has claimed responsibility for a blast outside a crowded polling station on election day in Pakistan which has claimed at least 31 lives.